MenuCheck FUNCTION Action Returns an integer that indicates which menu selection, if any, was made following a menu or shortcut-key event. Syntax variablename% = MenuCheck(action%) Remarks The MenuCheck procedure uses the following arguments. variablename% ------------- Any BASIC variable name, including the name of a record variable or record element. action% ------- An integer that identifies the specific information requested. Values are as follows. Value Associated action-Return value 0 Checks to see if a menu item was selected since MenuCheck was last called. If a menu item was selected, MenuCheck returns the number of the menu and sets the global variables so that when MenuCheck(1) is called, the appropriate menu item number is returned. If no menu item was selected, returns 0. 1 Returns the matching menu item of the last menu selection. MenuCheck(1) is reset each after each call to MenuCheck(0). 2 Returns true (-1) if menu item has been selected as of the last MenuCheck(0) call, or false (0) if not. If a selection has occurred, use MenuCheck(0) and MenuCheck(1) to determine what selection was made. MenuCheck(2) changes no values. The MenuCheck procedure simulates polling for a menu event. When a menu event occurs, global variables are set to their appropriate values. MenuCheck(0) then returns the menu number, or 0 if no menu was selected since the last call to MenuCheck. You can use MenuCheck to provide information about menu selection as follows. kbd$ = MenuInkey$ SELECT CASE kbd$ CASE "menu" menu = MenuCheck(0) item = MenuCheck(1) MouseHide PRINT menu, item MouseShow CASE ELSE PRINT kbd$ END SELECT or MenuEvent IF MenuCheck(2) THEN menu = MenuCheck(0) item = MenuCheck(1) MouseHide PRINT menu, item MouseShow END IF See Also MenuEvent, MenuInkey$, ShortCutKeyEvent Example See the main loop of the code example UIDEMO.BAS for a practical implementation of the MenuCheck procedure.